import { lightBlue, yellow } from 'kolorist'

// export type VARIANT = Required< Omit< FRAMEWORK, 'variants'>> // 删除FRAMEWORK中的variants 再全部转换为必填
export type VARIANT = {
  name: string
  color: (str: string | number) => string
  description: string
  downloadUrl: URL
}

export interface FRAMEWORK extends Omit< VARIANT, 'downloadUrl'> { // 删除VARIANT中的downloadUrl
  variants?: VARIANT[]
  downloadUrl?: URL
}

export const frameWorks = [
  {
    name: 'vue',
    color: yellow,
    description: 'vue模板合集',
    variants: [
      {
        name: 'vite-template',
        color: lightBlue,
        description: '一套完整的 vue3 + Vite + ElementPlus 后台管理系统 拥有完善的权限体系，常用组件封装',
        downloadUrl: 'https://gitee.com/justit/vite-template/repository/archive/master.zip'
      },
      {
        name: 'vite-js-template',
        color: lightBlue,
        description: '一套 vue3 + Vite + Js 开发模板',
        downloadUrl: 'https://gitee.com/justit/vite-js-template/repository/archive/master.zip'
      },
      {
        name: 'vite-ts-template',
        color: lightBlue,
        description: '一套 vue3 + Vite + Ts 开发模板',
        downloadUrl: 'https://gitee.com/justit/vite-ts-template/repository/archive/master.zip'
      },
      {
        name: 'nuxt3-template',
        color: lightBlue,
        description: '一套 nuxt3 + Ts 开发模板',
        downloadUrl: 'https://gitee.com/justit/nuxt3-template/repository/archive/master.zip'
      },
      {
        name: 'vue2-html-template',
        color: lightBlue,
        description: 'vue+h5 开发模板 一般用于后端项目iframe嵌套',
        downloadUrl: 'https://gitee.com/justit/vue2-html-template/repository/archive/master.zip'
      }
    ]
  },
  {
    name: 'uniapp',
    color: yellow,
    description: 'uniapp模板合集',
    variants: [
      {
        name: 'vite-uniapp',
        color: lightBlue,
        description: '一套 vue3 + Vite + wot-design-uni 的uniapp cli开发模板',
        downloadUrl: 'https://gitee.com/justit/vite-uniapp-template/repository/archive/master.zip'
      }
    ]
  },
  {
    name: 'node',
    color: yellow,
    description: 'node模板合集',
    variants: [
      {
        name: 'node-js-template',
        color: lightBlue,
        description: '一个基于 CommonJs 标准的nodeJs的运行时模板',
        downloadUrl: 'https://gitee.com/justit/node-js-template/repository/archive/master.zip'
      },
      {
        name: 'node-ts-tsup-template',
        color: lightBlue,
        description: '一个基于 ES Module 标准 tsup 打包的nodeTs的开发模板，集成standard、commander等',
        downloadUrl: 'https://gitee.com/justit/node-ts-tsup-template/repository/archive/master.zip'
      },
      {
        name: 'node-ts-rollup-template',
        color: lightBlue,
        description: '一个基于 ES Module 标准 rollup 打包的nodeTs的开发模板，集成standard、commander等',
        downloadUrl: 'https://gitee.com/justit/node-ts-rollup-template/repository/archive/master.zip'
      }
    ]
  },
  {
    name: 'utils',
    color: lightBlue,
    description: '常用工具仓库 集成各种开箱即用的工具函数',
    downloadUrl: 'https://gitee.com/justit/utils/repository/archive/master.zip'
  },
  {
    name: 'tampermonkey',
    color: lightBlue,
    description: 'vue3+vant 油猴脚本开发模板',
    downloadUrl: 'https://gitee.com/justit/tampermonkey/repository/archive/master.zip'
  }
]
